<template>
    <div>
        <a-modal
            v-model:visible="visible"
            title="打印会议记录"
            @ok="handleOk"
            width="100%"
            wrapClassName="full-modal"
            :footer="null"
        >
            <div style="display: flex;margin: 10px;">
                <a-button class="blue-btn" type="primary" v-print="printObj">打印</a-button>
            </div>
            <div style="height: calc(100vh - 160px);overflow-y: auto;" v-if="visible">
                <div id="printRecordTable" :key="printRecordKey">
                    <div >
                        <div style="text-align: center;padding: 10px;">
                            <h2>会议记录</h2>
                        </div>
                        <!-- 会议记录 -->
                        <table border="1" style="width: 100%;">
                            <tr>
                                <th>会议标题</th>
                                <th>会议地点</th>
                                <th>会议类型</th>
                                <th>会议时间</th>
                                <th>会议摘要</th>
                                <th>记录人员</th>
                                <th>会议状态</th>
                            </tr>
                            <tr v-for="(item,index) in dataList" :key="index">
                                <td>{{ item.hy.fhybt }}</td>
                                <td>{{ item.hy.fhydd }}</td>
                                <td>{{ item.hy.fhylx }}</td>
                                <td>{{ item.hy.fhysj }}</td>
                                <td>{{ item.hy.fhyzy }}</td>
                                <td>{{ item.hy.fhyjlryxm }}</td>
                                <td>{{ item.hy.fhyzt }}</td>
                            </tr>
                        </table>
                        <div style="page-break-after:always"></div>
                    </div>
                </div>
            </div>
        </a-modal>
    </div>
</template>
<script>
import {
    partyHyqueryPrintDataList,
} from './service/index'
export default {
    components:{

    },
    props:{

    },
    data(){
        return{
            visible:false,
            dataList:[],
            printObj:{
                id:"printRecordTable", //需要打印的id名称
                popTitle:"会议记录",//文档的名称
                // preview:true,//预览功能，不好用
                zIndex:'20002',
            },
            printRecordKey:null,
        }
    },
    watch:{

    },
    mounted(){

    },
    methods:{
        getData(val){
            this.printRecordKey = Date.now()
            this.dataList = []
            partyHyqueryPrintDataList(val).then(res=>{
                if(res.code == 200){
                    // this.#message.success(res.message)
                    this.dataList = res.result
                }else{
                    this.$message.warning(res.message)
                }
            })
        },

        handleOk(){

        },
    }
}
</script>
<style lang="less" scoped>
#printRecordTable{
    th{
        text-align: center;
        width: 120px;
        padding: 10px 0;
        vertical-align: middle;
        font-weight: 600;
        font-size: 16px;
    }
    td{
        padding: 10px;
        text-align: center;
        color: #000;
    }
}

.full-modal {
  .ant-modal {
    max-width: 100%;
    top: 0;
    padding-bottom: 0;
    margin: 0;
  }
  .ant-modal-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh);
  }
  .ant-modal-body {
    flex: 1;
  }
}
</style>
